home *** CD-ROM | disk | FTP | other *** search
- //
- // MiscMergeCommand.h -- abstract class to build merge commands from
- // Written by Don Yacktman Copyright (c) 1995 by Don Yacktman.
- // Version 1.0. All rights reserved.
- // This notice may not be removed from this source code.
- //
- // This object is included in the MiscKit by permission from the author
- // and its use is governed by the MiscKit license, found in the file
- // "LICENSE.rtf" in the MiscKit distribution. Please refer to that file
- // for a list of all applicable permissions and restrictions.
- //
-
-
- // This object is a structure to contain a parsed mail merge command
- // and implement a specific command; subclasses should exist for
- // each command in the language.
-
- #import <appkit/appkit.h>
- #import <misckit/miscmerge.h>
-
- @interface MiscMergeCommand : Object
- {
- // This class is abstract; subclasses will have instance
- // variables to hold parsed arguments, if there are any.
- }
-
- - initFrom:(MiscString *)aString; // MUST be a MiscString!
-
- // Subclasses must implement the next two methods:
-
- // Parse the arguments to the command
- - parseFromString:(MiscString *)aString;
- // Implementation of the command; a subclass responsibility!
- - executeForMerge:(MiscMergeEngine *)aMerger;
-
-
-
- /*" Methods to aid in parsing "*/
- // All these parsing methods do two things:
- // (1) Extract the desired syntactical item from the front of
- // the passed-in string and return it
- // (2) Delete said item from the front of the string.
-
- // Eats a keyword that is supposed to be there (or optional)
- // and returns YES if it found it, NO otherwise
- - (BOOL)eatKeyWord:(MiscString *)aKeyWord from:(MiscString *)aString
- isOptional:(BOOL)flag;
-
- // gets a string argument, whatever that may be, and returns it
- - getArgumentStringFrom:(MiscString *)aString toEnd:(BOOL)endFlag;
-
- // gets a prompt, and only a prompt (ie, "?" followed by an argument)
- - getPromptFrom:(MiscString *)aString toEnd:(BOOL)endFlag;
-
- // Gets either a prompt or a string argument
- - getPromptableArgumentStringFrom:(MiscString *)aString
- wasPrompt:(BOOL *)prompt toEnd:(BOOL)endFlag;
-
- // Gets some type of condition; see types at the top of this file
- - (MISC_Merge_Cond_Op)getConditionalFrom:(MiscString *)aString;
-
-
- /*" Errors subclasses may trap "*/
- - (void)error_conditional:(MiscString *)theCond;
- - (void)error_keyword:(MiscString *)aKeyWord;
- - (void)error_noprompt;
- - (void)error_closequote;
-
- + (BOOL)evaluateConditionWith:(MiscMergeEngine *)anEngine
- for:aCommand;
-
- @end
-